import cv2 as cv

#分别使用SIFT、FAST及ORB算子检测角点，并比较分析检测结果。
img = cv.imread('../pic/chessBoardS.png')
# img = cv.imread('../pic/lena.jpg')
sift = cv.xfeatures2d.SIFT_create()
key = sift.detect(img, None)
img2 = img.copy()
img2 = cv.drawKeypoints(img, key, img2, color=(0,255,0))
cv.imshow('SIFT', img2)


##FAST
fast = cv.FastFeatureDetector_create()
key = fast.detect(img, None)
img2 = img.copy()
img2 = cv.drawKeypoints(img, key, img2, color=(0,255,0))
cv.imshow('FAST', img2)


#ORB
orb = cv.ORB_create()
key = orb.detect(img, None)
img2 = img.copy()
img2 = cv.drawKeypoints(img, key, img2, color=(0,255,0))
cv.imshow('ORB', img2)
cv.waitKey(0)
